package com.example.ljw.frescowallpaper.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by StevenWang on 16/6/15.
 */
public class MyPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> mList = null;
    private String[] mArrTitles = null;

    public MyPagerAdapter(FragmentManager fm , List<Fragment> list , String[] arrTitles) {
        super(fm);
        this.mList = list;
        this.mArrTitles = arrTitles;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mArrTitles[position];
    }
}
